#ifndef __CARCON__
#define __CARCON__

#include <string>
#include <unordered_map>
#include "MapFunc.h"
#include "SmartCar.h"

/**
 * 智能车控制器
 */
class CarController {
    private:
        // 智能车表
        std::unordered_map<std::string,SmartCar*> carMap;
    public:
        CarController();
        ~CarController();
        SmartCar* createCar();
        SmartCar* createCar(const std::string id);
        SmartCar* createCar(SmartCar* sampleCar);
        SmartCar* findCar(const std::string id);
        void deleteCar(SmartCar* car);
        int getCarCount();
        void listAllCar(SmartCar* (&carList)[]);
        SmartCar* strToSmartCar(std::istringstream &iss);
        
};

#endif